// import request from '@/utils/request'
// import type { LoginData, LoginResData } from './type'

// export const loginreq = async (data: LoginData) => {
//   return request.post<any, LoginResData>('/api/user/login', data)
// }

// export const Initreq = async () => {
//   return request.get<any, any>('/api/user/info')
// }

import request from '@/utils/request'
import type {LoginResponse,UserInfoResponse,LoginRequest,LoginOutResponse} from '@/api/user/type'
// enum API{
//   LOGIN_URL = '/admin/acl/index/login',
//   USERINFO_URL = '/admin/acl/index/info',
//   LOGINOUT_URL = '/admin/acl/index/logout',
// }
enum API{
  LOGIN_URL = '/User/login',
  USERINFO_URL = '/User/info',
  LOGINOUT_URL = '/admin/acl/index/logout',
}
//登录
export const reqLogin = (data:LoginRequest)=>request.post<any,LoginResponse>(API.LOGIN_URL ,data)
//获取信息
export const reqUserInfo = () => request.get<any,UserInfoResponse>(API.USERINFO_URL)
//退出
export const reqLoginOut = () => request.post<any,LoginOutResponse>(API.LOGINOUT_URL)
